package com.xdbigdata.sync.controller;

import com.xdbigdata.framework.web.model.JsonResponse;
import com.xdbigdata.sync.service.TestService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author XD
 * @date 2019/9/19 10:03
 */
@RestController
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class TestController {

    @Autowired
    private TestService testService;

    @ApiOperation(value = "生成数据")
    @GetMapping(value = "saveData")
    public JsonResponse saveData() {
        testService.saveData();
        return JsonResponse.successMessage("操作成功");
    }

}
